//
// Created by "huxiao" on 2025/5/17 12:23
//

#ifndef STATUS_H
#define STATUS_H

#include <string>

enum class StatusCode {
    // 操作成功
    OK = 200,
    // 操作失败
    FAILED = 400,
    // 用户名不存在
    USER_NOT_EXIST = 401,
    // 密码错误
    PASSWORD_ERROR = 402,
    // 用户已存在
    USER_EXIST = 403,
};

inline std::string StatusCodeToMsg(const StatusCode code) {
    switch (code) {
        case StatusCode::OK:
            return "操作成功";
        case StatusCode::FAILED:
            return "操作失败";
        case StatusCode::USER_NOT_EXIST:
            return "用户名不存在";
        case StatusCode::PASSWORD_ERROR:
            return "密码错误";
        case StatusCode::USER_EXIST:
            return "用户已存在";
        default:
            return "未知状态";
    }
}

#endif // STATUS_H
